home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 118 / cd-rom 118.iso / aplic / open / openofficeorg4.cab / HelloWorld.py < prev    next >
Encoding:
Python Source  |  2005-02-11  |  489 b   |  15 lines

  1. # HelloWorld python script for the scripting framework
  2.  
  3. def HelloWorldPython( ):
  4.     """Prints the string 'Hello World(in Python)' into the current document"""
  5. #get the doc from the scripting context which is made available to all scripts
  6.     model = XSCRIPTCONTEXT.getDocument()
  7. #get the XText interface
  8.     text = model.Text
  9. #create an XTextCursor
  10.     cursor = text.createTextCursor()
  11. #and insert the string
  12.     text.insertString( cursor, "Hello World (in Python)", 0 )
  13.     return None
  14.  
  15.